-
Notifications
You must be signed in to change notification settings - Fork 425
feat: add HTTP endpoint to control prof.gdump feature #6999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fengjiachun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Others LGTM
|
Maybe we should expose a key-value API for malloc conf. So we don't have to add an API for each configuration. |
### Add Support for Jemalloc Gdump Flag - **`jemalloc.rs`**: Introduced `PROF_GDUMP` constant and added functions `set_gdump_active` and `is_gdump_active` to manage the gdump flag. - **`error.rs`**: Added error handling for reading and updating the jemalloc gdump flag with `ReadGdump` and `UpdateGdump` errors. - **`lib.rs`**: Exposed `is_gdump_active` and `set_gdump_active` functions for non-Windows platforms. - **`http.rs`**: Added HTTP routes for checking and toggling the jemalloc gdump flag status. - **`mem_prof.rs`**: Implemented handlers `gdump_toggle_handler` and `gdump_status_handler` for managing gdump flag via HTTP requests. Signed-off-by: Lei, HUANG <[email protected]>
Co-authored-by: shuiyisong <[email protected]>
Signed-off-by: Lei, HUANG <[email protected]>
I further considered that, if we expose key-value api, we still need to
Later I read the |
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your intention?
prof.gdumpis a convenient features provided by jemalloc that dumps the memory profiling data every time the memory usage exceeds previous maximum value. This PR adds an HTTP endpoint to control the status ofprof.gdump.Add Support for Jemalloc Gdump Flag
jemalloc.rs: IntroducedPROF_GDUMPconstant and added functionsset_gdump_activeandis_gdump_activeto manage the gdump flag.error.rs: Added error handling for reading and updating the jemalloc gdump flag withReadGdumpandUpdateGdumperrors.lib.rs: Exposedis_gdump_activeandset_gdump_activefunctions for non-Windows platforms.http.rs: Added HTTP routes for checking and toggling the jemalloc gdump flag status.mem_prof.rs: Implemented handlersgdump_toggle_handlerandgdump_status_handlerfor managing gdump flag via HTTP requests.PR Checklist
Please convert it to a draft if some of the following conditions are not met.